clk: bcm2835: Minimise clock jitter for PCM clock
authorPhil Elwell <phil@raspberrypi.org>
Mon, 22 May 2017 12:56:41 +0000 (13:56 +0100)
committerPhil Elwell <phil@raspberrypi.org>
Tue, 23 May 2017 15:56:54 +0000 (16:56 +0100)
commit76527b4e6a5dbe55e0b2d8ab533c2388b36c86be
treeb8be00d85b87d9e888399ad378b0693171b01264
parent3f9f5160d86ef1b74b1e795bf37df9413d6559aa
clk: bcm2835: Minimise clock jitter for PCM clock

Fractional clock dividers generate accurate average frequencies but
with jitter, particularly when the integer divisor is small.

Introduce a new metric of clock accuracy to penalise clocks with a good
average but worse jitter compared to clocks with an average which is no
better but with lower jitter. The metric is the ideal rate minus the
worse deviation from that ideal using the nearest integer divisors.

Use this metric for parent selection for clocks requiring low jitter
(currently just PCM).

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
drivers/clk/bcm/clk-bcm2835.c